from .proto.utils import itob

# 读配置空间请求
PAYLOAD_REQ_TO_MCU_GET_PARAM = b'\x01'
# 读配置空间响应
PAYLOAD_RSP_FR_MCU_GET_PARAM = b'\x02'
# 写配置空间请求
PAYLOAD_REQ_TO_MCU_SET_PARAM = b'\x03'
# 写配置空间响应
PAYLOAD_RSP_FR_MCU_SET_PARAM = b'\x04'
# 读配置主项请求
PAYLOAD_REQ_TO_MCU_GET_CLASS = b'\x05'
# 读配置主项响应
PAYLOAD_RSP_FR_MCU_GET_CLASS = b'\x06'
# 注册请求
PAYLOAD_REQ_FR_MCU_REGITSTER = b'\x07'
# 注册响应
PAYLOAD_RSP_TO_MCU_REGITSTER = b'\x08'
# 心跳请求
PAYLOAD_REQ_FR_MCU_HEART_BEAT = b'\x09'
# 心跳响应
PAYLOAD_RSP_TO_MCU_HEART_BEAT = b'\x0a'
# 开始历史数据发送请求
PAYLOAD_REQ_TO_MCU_START_REPORT_HIS_DATA = b'\x0b'
# 开始历史数据发送响应
PAYLOAD_RSP_FR_MCU_START_REPORT_HIS_DATA = b'\x0c'
# 设置网络请求
PAYLOAD_REQ_FR_MCU_START_REPORT_HIS_DATA = b'\x25'
# 设置网络响应
PAYLOAD_RSP_FR_MCU_START_REPORT_HIS_DATA = b'\x26'

# 数据自动上报请求
PAYLOAD_REQ_FR_MCU_UP_REPORT = b'\x13'
# 数据自动上报响应
PAYLOAD_RSP_TO_MCU_UP_REPORT = b'\x14'

#读取自动规则响应
PAYLOAD_RSP_FR_MCU_GET_AUTO_RULE = b'\x22'
#读取自动规则请求
PAYLOAD_REQ_TO_MCU_GET_AUTO_RULE = b'\x21'

#读取所有配置
PAYLOAD_REQ_READ_ALL_CONFIG = itob(1001)

# 重启设备
PAYLOAD_REQ_REBOOT = itob(1002)


# 开启设备自动上传
PAYLOAD_REQ_TO_MCU_ENABLE_UP_REPORT = b'\x11'

# 获取继电器状态
PAYLOAD_REQ_TO_MCU_GET_INPUT = b'\x1d'


# 修改继电器状态
PAYLOAD_REQ_TO_MCU_SET_OUTPUT = b'\x1f'

# 清除socket
CLEAN_TCP_CONNECT = itob(1010)
# 下行方向数据透传请求
PAYLOAD_REQ_TO_MCU_DOWN_TRANS = b'\x15'

# 设置自动规则请求
PAYLOAD_REQ_TO_MCU_SET_AUTO_RULE = b'\x23'